﻿using System;
using System.Data;
using System.Collections;
using CE.Database;

/// <summary>
/// Summary description for tblPaymentNotification

/// Table Name : [tblPaymentNotification]
/// Created By : CX
/// Created Date : Monday, June 27, 2011
/// </summary>
/// 
namespace CE.Payment
{

    public class PaymentNotificationDB
    {
        public PaymentNotificationDB()
        {	//TODO: Add constructor logic here

        }

        public Int64 Insert(PaymentNotification payment)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            //string strSQL = "Insert into tblPaymentNotification"            
            string _spName = "[sprocPaymentNotificationInsertUpdateSingleItem]";

            SortedList _sPara = new SortedList();

            #region Parameter            
            _sPara.Add("@QuoteRefNo", payment.QuoteRefNo);
            _sPara.Add("@Name", payment.Name);
            _sPara.Add("@MobileNo", payment.MobileNo);
            _sPara.Add("@Amount", payment.Amount);
            _sPara.Add("@PaymentDate", payment.PaymentDate);
            _sPara.Add("@PaymentHour", payment.PaymentHour);
            _sPara.Add("@PaymentMin", payment.PaymentMin);
            _sPara.Add("@Status", payment.Status);
            //_sPara.Add("@OrderRefNo", payment.OrderRefNo);
            //_sPara.Add("@ModifiedDate", payment.ModifiedDate);
            //_sPara.Add("@Info1", payment.Info1);
            //_sPara.Add("@NInfo1", payment.NInfo1);
            //_sPara.Add("@FInfo1", payment.FInfo1);
            //_sPara.Add("@Dinfo1", payment.Dinfo1);

            #endregion

            //_result = _db.ExecuteNonSqlStatement(strSQL, _sPara);
            //return _result > 0;

            _result = _db.ExecuteSP(_spName, _sPara);
            return _result;

            
        }

        public DataTable GetPaymentNotification(string QuoteRefNo)
        {
            MyDatabase _Db = new MyDatabase();
            string _spName = "sprocPaymentNotificationSelectSingleItem";            
            DataTable _dt;
            SortedList _sPara = new SortedList();

            _sPara.Add("@QuoteRefNo", QuoteRefNo);
            

            _dt = _Db.GetDataTableBySP(_spName, _sPara);

            return _dt;
        }

        #region remove
       
        //public bool Update()
        //{
        //    return true;
        //}

        //public bool Delete(Int64 id)
        //{
        //    MyDatabase _db = new MyDatabase();
        //    Int64 _result = -1;
        //    string _spName = "[sprocDelete]";

        //    SortedList _sPara = new SortedList();


        //    #region Parameter
        //    //_sPara.Add("@ID", id);
        //    //_sPara.Add("@ID2", id2);
        //    #endregion

        //    _result = _db.ExecuteSP(_spName, _sPara);

        //    return _result > 0;
        //}

        #endregion
    }

}

